﻿using System;
using System.ComponentModel;
using System.Linq;
using System.Data.Linq;
using System.Data.Linq.Mapping;
using System.Reflection;

namespace Ample.Model
{
    public partial class Order : INotifyPropertyChanging, INotifyPropertyChanged
	{
        private string _status;
        public string Status
        {
            get
            {
                return this.OrderStatuses.Where(o => o.AddedDate == this.OrderStatuses.Max(os => os.AddedDate)).Select(
                    o => o.Status).SingleOrDefault();
            }
            set
            {
                this._status = value;
            }
        }

        public string UserName
        {
            get
            {
                return this.User.UserName;
            }
        }
    }
}
